package edu.ar.modulo3.perist.common;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class HibernateManager {

	private static final SessionFactory _sessionFactory = buildSessionFactory();
	
	private static SessionFactory buildSessionFactory() {
				
		return new Configuration().configure("/config/hibernate.cfg.xml").buildSessionFactory();
	}
	
	// remove the defaul constructor
	private HibernateManager() {		
	}
	
	public static SessionFactory getSessionFactoryInstance() {
		return _sessionFactory;
	}	
}
